🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / repository / src / commonMain / kotlin / org / meshtastic / core / repository / FixedPositionAdminMessage.kt
Displaying Raw • Download
core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/FixedPositionAdminMessage.kt 65a1f5ce4d0e4b8eafcd0bbfccafd41dc6ee888a (65a1f5ce) Text, 1.44 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.repository
Tff7b72import T7ee787org.meshtastic.core.model.Position
Tff7b72import T7ee787org.meshtastic.proto.AdminMessage
Tff7b72import T7ee787org.meshtastic.proto.Position Tff7b72as Te6edf3ProtoPosition
T8b949e/** Converts the model position to the exact protobuf payload used by fixed-position admin commands. */
Tff7b72fun Te6edf3PositionTb4b4b4.Td2a8fftoFixedPositionProtoTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3ProtoPosition Tff7b72=
Te6edf3ProtoPositionTb4b4b4(Te6edf3latitude_i Tff7b72= Te6edf3PositionTb4b4b4.Te6edf3degITb4b4b4(Te6edf3latitudeTb4b4b4)Tb4b4b4, Te6edf3longitude_i Tff7b72= Te6edf3PositionTb4b4b4.Te6edf3degITb4b4b4(Te6edf3longitudeTb4b4b4)Tb4b4b4, Te6edf3altitude Tff7b72= Te6edf3altitudeTb4b4b4)
T8b949e/** Builds the device admin command for setting or removing a fixed position. */
Tff7b72fun Te6edf3PositionTb4b4b4.Td2a8fftoFixedPositionAdminMessageTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3AdminMessage Tff7b72= Tff7b72if Tb4b4b4(Te6edf3isFixedPositionRemovalTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3AdminMessageTb4b4b4(Te6edf3remove_fixed_position Tff7b72= Tff7b72trueTb4b4b4)
Tb4b4b4} Tff7b72else Tb4b4b4{
Te6edf3AdminMessageTb4b4b4(Te6edf3set_fixed_position Tff7b72= Te6edf3toFixedPositionProtoTb4b4b4(Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s